package com.itheima.d1_file;

import java.io.File;
import java.text.SimpleDateFormat;

public class FileTest2 {
    public static void main(String[] args) {

        File f1 =new File("D:\\resourse\\b.txt");

        System.out.println(f1.exists());

        System.out.println(f1.isFile());

        System.out.println(f1.isDirectory());

        System.out.println(f1.getName());

        System.out.println(f1.length());

        long time =f1.lastModified();
        SimpleDateFormat sdf =new SimpleDateFormat("yyy/MM/dd HH:mm:ss");
        System.out.println(sdf.format(time));

        File f2 =new File("D:\\java相关\\java项目\\code\\Javasepro\\Day17\\src\\b.txt");
        File f3 =new File("Day17\\src\\b.txt");
        System.out.println(f2.getPath());
        System.out.println(f3.getPath());

        System.out.println(f2.getAbsoluteFile());
        System.out.println(f3.getAbsoluteFile());
    }
}
